<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script crossorigin="anonymous"  src="./jquery.min.js"></script>
    <script crossorigin="anonymous"  src="./echarts.min.js"></script>
    <script crossorigin="anonymous"  src= "./dataTool.min.js " ></script>
    
    <link href="./bootstrap.min.css" rel="stylesheet">
    <script src="/bootstrap.min.js"  type="text/javascript"></script>
    <script crossorigin="anonymous"  src="./angular.min.js"></script>
    <style>
        .btn-primary {
    background-color: #3c8dbc;
    border-color: #367fa9;
}
.btn {
    border-radius: 3px;
    -webkit-box-shadow: none;
    box-shadow: none;
    border: 1px solid transparent;
}
    </style>
</head>
<body>
    <div class="content-wrapper" ng-app="myApp"  ng-controller="menu">
        <!-- Content Header (Page header) -->
        <section class="content-header"></section>

        <section class="content col-xs-8" id="welcome" style="height: 600px; left: 200px; padding: 0px; position: relative; "></section>
    
      </div>
<script>



var app = angular.module('myApp', [ ]);

app.controller('menu', function($scope, $http) {
 
    var img=$("#ImgNavigation")
    var step=getCookie("stepNumber")
    if (step=='') {
        step=1;
        setCookie("stepNumber",1,"d900")
    }
    img.attr('width', "");
    img.attr('src', 'dist/img/daohang.jpg');
    img.load(function(){
        // img.addClass('img-responsive')
        setImgArea()
        display(0)
    })

    // 获取学科和课程数据
    $http.get(ip+"/domain/getDomainsGroupBySubject").success(
        function(response) { 
            //响应response相对，增加状态信息和编码
            data = response["data"];
            $scope.subjects = response["data"];

            var classSum = 0;
            // 切回导航页面时，读取现有课程并更新两个框的值
            for(i = 0; i < data.length; i++) {
                classSum = classSum + data[i].domains.length;
                if(data[i].subjectName == getCookie("NowSubject")) {
                    $scope.subject = data[i];
                    for(j = 0; j < data[i].domains.length; j++) {
                        if(data[i].domains[j].domainName == getCookie("NowClass")) {
                            $scope.domain = data[i].domains[j];
                        }
                    }
                }
            }
            $scope.subjectNum = data.length;
            $scope.classSum = classSum;
        }
    );

    $scope.change = function(){  
        //获取被选中的值  
        var chengeitem = $scope.domain.domainName;
        setCookie("NowClass", $scope.domain.domainName, "d900");
        setCookie("NowSubject", $scope.subject.subjectName, "d900");
        //js代码实现option值变化后的查询等操作      
    } 

})




    </script>
</body>
</html>